﻿@using Kugar.UI.Web.AdminLTE
@using Kugar.UI.Web.AdminLTE.Enums
@using Kugar.UI.Web.AdminLTE.Helpers
@using Kugar.UI.Web.AdminLTE.Helpers.FormExtMethod
@using Kugar.UI.Web.AdminLTE.PageControls
@using Kugar.UI.Web.AdminLTE.PageControls.Helpers.ButtonExtMethod
@using Kugar.UI.Web.AdminLTE.PageControls.PageForms
@model Kugar.UI.Web.AdminLTE.Models.Model_AdminInfo

@inject AdminLTEUI WebUI

@{
    Layout = null;
}

@using (WebUI.Control.ModalWindow().Title("管理员详情").ContentHeight(300).ID("divAdminDetail")
   .AddRightButton(btn => btn.Color(ColorPaletteEnum.primary).Text("保存").Type(ButtonTypeEnum.submit))
   .Render())
{
    using (var frm = WebUI.Control.Form().Post().UpdateElementID("divAdminDetail").Render())
    {
        if (string.IsNullOrWhiteSpace(Model.UserID))
        {
            @frm.AddTextBox().Label("账号").Value(Model.UserName).Name("UserName").Render()
        }
        else
        {
            @frm.AddLabel().Label("账号").Value(Model.UserName).Render()
        }

        if (string.IsNullOrWhiteSpace(Model.UserID))
        {
            @frm.AddTextBox().Label("密码").Name(Model.Password).Name("Password").Render()
        }

        @frm.AddSelector().Label("状态").Options(new []
                                               {
                                                   new SelectorItem("正常","0"),
                                                   new SelectorItem("禁用","99"),
                                               }).CurrentValue(Model.State).Name("State").Render()


    }
}